package com.suxiaoxiao.springbootlearn.designpattern.commandpattern.commands.light;

import com.suxiaoxiao.springbootlearn.designpattern.commandpattern.commands.Command;

/**
 * 电灯关闭命令
 *
 * @author 、
 */
public class LightOffCommand implements Command {

    Light light;

    public LightOffCommand(Light light) {
        this.light = light;
    }

    @Override
    public void execute() {
        light.off();
    }

    @Override
    public void undo() {
        light.on();
    }

}
